ifneq ($(KERNELRELEASE),)
MODULE_NAME := hello_world
$(MODULE_NAME)-y := hello-world.o
obj-m := $(MODULE_NAME).o
else
# kernel build directory, which contains .config, Module.symvers, etc.
KDIR := /lib/modules/`uname -r`/build
# module source directory
MDIR := $(shell pwd)
.PHONEY: modules clean
all: modules
modules:
	$(MAKE) -C $(KDIR) M=$(MDIR) modules
clean:
	$(MAKE) -C $(KDIR) M=$(MDIR) clean
endif
